<template>
 <div class="school demo">
    <h2>学校名称：{{name}}</h2>
    <h2>学校地址：{{address}}</h2>
 </div>
</template>

<script>

export default {
  name: 'School',
  data() {
    return {
      name: "名称",
      address: '自贸试验区亚洲路'
    }
  },
  mounted() {
    // console.log(`School`, window.x)
    // console.log(`School`, this.x)
    this.$bus.$on('test', (data) => {
      console.log('我是School组件，收到了数据', data)
    })
  },
  beforeDestroy() {
    this.$bus.$off('test')
  },
}
</script>
<style lang="less" scpoed>
.school {
  background-color: skyblue;
  h2 {
    font-size: 16px;
  }
}
.demo {
  color: green;
}
</style>
